<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.jiang.service.IMemberService"%>
<%@page import="com.jiang.service.impl.MemberServiceImpl"%>
<%@page import="com.jiang.factory.ServiceFactory"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.jiang.vo.Member"%>
<%@page import="java.util.Enumeration"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
    	
    	<%
    			request.setCharacterEncoding("UTF-8");
				String idsStr= request.getParameter("ids");
				List<Member> members = new ArrayList<Member>(5);
				String[] ids = idsStr.split(",");
				for(int i=0;i<ids.length;i++) {
						Member m = new Member();
						m.setMid(ids[i]);
						members.add(m);
				}
				IMemberService memberService = ServiceFactory.getInstance(MemberServiceImpl.class);
   				boolean add_result = memberService.deleteBatch(members);
   				String msg = "";
   				String url = basePath +"message.jsp";
   				String type="用户信息列表";
   				if(add_result) {
   					msg = "删除用户信息成功!";
   				}else{
   					msg = "删除用户信息失败!";
   				}
   				
    	%>
				 <jsp:forward page="message.jsp">
				 		<jsp:param value="<%=msg %>" name="result_msg"/>
				 		<jsp:param value="<%=url %>" name="url"/>
				 		<jsp:param value="<%=type %>" name="type"/>
				 </jsp:forward>
    		
    	
 	</body>
</html>